use vudu
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		juan
-- este procedimiento busca las materias de un 
--semestre actual
-- =============================================
CREATE PROCEDURE sp_materias_pensum_actual 
	@id_escuela int
	
	 
AS
BEGIN


	SELECT DISTINCT fk_id_pensum,semestre, nombreMateria 
    FROM PensumMateria, Materia, Pensum, Escuela
	WHERE (id_Materia=fk_id_materia)and 
	(fk_id_pensum=id_pensum) and 
	(fechaFIn IS NULL)and 
	(fk_id_escuela=@id_escuela)	
	ORDER BY semestre
END
GO
